Timing Events and Heartbeats

by Janet Terra

copyright 2004

janetterra@yahoo.com

Home

Tip Corner

API Corner

Just for fun

Timing Events

QCard Lesson

Menus: Checkmarks

Dissolve Demo

Encryption

Poker Game

Snip Manager

Demos

Newsletter help

Index


The Time$() Command

The Liberty BASIC Time$() command can be used to not only tell the correct time, but also to plan timed events. The time intervals are often fixed, such as would be needed when programming a watch or a stop watch (See article by Bill Beasley [Issue #116]). With other events, like arcade games, it is more desirable to have non-fixed time intervals between events for a more random effect. "Timing Events and Heartbeats" in Liberty BASIC Lesson Browser form (timingEvents.lsn) shows how to

  1. Use the Time$("milliseconds") to measure tenths and hundredths of a second
  2. Play a .wav file at both fixed and random intervals
  3. Draw a clock with a more realistic sweeping second hand
  4. Recognize the difference between a regular and an irregular heart beat rhythm

The program concludes with a simple Heartbeat simulation that can be used as a tutorial / drill and practice educational program for nursing and other health care students.

This demonstration shows that the Liberty BASIC Lesson Browser has a use in the classroom for teaching even non-programming skills.

"Timing Events and Heartbeats is geared toward the novice programmer. The code does contain user-defined functions. For further assistance with identifying, understanding and incorporating user-defined functions in your programs, first read the Liberty BASIC Help File (Function and Functions and Subroutines). Next, read "Function Fundamentals" by Alyce Watson [Issue #114].


To work through this tutorial on timing events, unzip the files from this issue to a folder on your hard drive. Open timingEvents.lsn in Liberty BASIC's lesson browser. The required files are

These files must be in the same folder as timingEvents.lsn file. Be sure to open the timingEvents.lsn file to go through the lesson.


Home

Tip Corner

API Corner

Just for fun

Timing Events

QCard Lesson

Menus: Checkmarks

Dissolve Demo

Encryption

Poker Game

Snip Manager

Demos

Newsletter help

Index